#!/bin/bash
environment=$1
echo $environment
if [[ -n ${environment} ]]; then
    echo $environment | tr "," "\n" > env.txt
    while read line; do
        str=$(echo $line)
        echo $str
        sed -i "/environment/a\      $str" docker-compose.tpl
    done < env.txt
else
    sed -i 's/environment://g' docker-compose.tpl
fi
